﻿<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReferencedAssemblies="System.dll&#13;&#10;System.Core.dll&#13;&#10;System.Drawing.dll&#13;&#10;System.Windows.Forms.dll&#13;&#10;System.Data.dll&#13;&#10;System.Xml.dll&#13;&#10;Sungero.Domain.Shared&#13;&#10;Sungero.CoreEntities.Shared&#13;&#10;Sungero.Reporting.Shared&#13;&#10;CommonLibrary&#13;&#10;Sungero.Content&#13;&#10;Sungero.Domain&#13;&#10;Sungero.Content.Shared&#13;&#10;Sungero.Domain.Interfaces&#13;&#10;Sungero.Workflow.Interfaces&#13;&#10;Sungero.Docflow.Shared&#13;&#10;Sungero.Docflow.Server" ReportInfo.CreatorVersion="2020.2.12.0">
  <ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using FastReport;
using FastReport.Data;
using FastReport.Dialog;
using FastReport.Barcode;
using FastReport.Table;
using FastReport.Utils;
using Sungero.Docflow;
using Sungero.Domain.Shared;
using Sungero.CoreEntities;
using Sungero.Core;
using Resources = Sungero.Docflow.Reports.Resources;


namespace FastReport
{
  public class ReportScript
  {
  }
}
  </ScriptText>
  <Dictionary>
    <SungeroSqlDataConnection Name="Sungero_Connection" Restrictions="DontModify, DontEdit, DontDelete, HideAllProperties" ConnectionStringExpression="[SungeroConnectionString]">
      <TableDataSource Name="Table" Alias="LetterRequisites" DataType="System.Int32" Enabled="true" CanEdit="true" SelectCommand="${DataSource}">
        <Column Name="Id" DataType="System.Int32" PropName="Column"/>
        <Column Name="ToName" DataType="System.String" PropName="Column"/>
        <Column Name="FromName" DataType="System.String" PropName="Column"/>
        <Column Name="ToZipCode" DataType="System.String" PropName="Column"/>
        <Column Name="FromZipCode" DataType="System.String" PropName="Column"/>
        <Column Name="ToPlace" DataType="System.String" PropName="Column"/>
        <Column Name="FromPlace" DataType="System.String" PropName="Column"/>
        <CommandParameter Name="ReportSessionId" DataType="16" IsDbType="true" Expression="[ReportSessionId]"/>
      </TableDataSource>
    </SungeroSqlDataConnection>
    <SungeroParameter Name="SungeroConnectionString" Restrictions="DontModify, DontEdit, DontDelete, HideAllProperties, DontShow" Id="770ac42f-f924-4d0c-8b98-2fddca65166c" IsRequired="false" IsCollection="false" InternalDataType="System.String" IsSimpleDataType="false" EntityTypeId="00000000-0000-0000-0000-000000000000"/>
    <SungeroParameter Name="ReportSessionId" Id="e5985b53-b0ff-43b3-b0c8-00fcd6ce3100" IsRequired="false" IsCollection="false" InternalDataType="System.String" IsSimpleDataType="false" EntityTypeId="00000000-0000-0000-0000-000000000000"/>
    <SungeroParameter Name="PrintSender" Id="f0a14e76-edf7-4f76-a789-004e3c02ef32" IsRequired="false" IsCollection="false" InternalDataType="System.Boolean" IsSimpleDataType="true" EntityTypeId="00000000-0000-0000-0000-000000000000"/>
    <SungeroParameter Name="OutgoingDocuments" Id="c054f027-af71-43e6-a987-10c6ed3eb71d" IsRequired="false" IsCollection="true" InternalDataType="Sungero.Docflow.IOutgoingDocumentBase, Sungero.Domain.Interfaces" IsSimpleDataType="false" EntityTypeId="f5f104fb-52e4-422b-9de1-a36937d85a2d"/>
    <SungeroParameter Name="ContractualDocuments" Id="41e6dbbd-2a8d-434d-a2a4-f0b000087fd0" IsRequired="false" IsCollection="true" InternalDataType="Sungero.Docflow.IContractualDocumentBase, Sungero.Domain.Interfaces" IsSimpleDataType="false" EntityTypeId="454df3c6-b850-47cf-897f-a10d767baa77"/>
    <SungeroParameter Name="AccountingDocuments" Id="a76f6239-2fac-4687-9977-b62ab28a3711" IsRequired="false" IsCollection="true" InternalDataType="Sungero.Docflow.IAccountingDocumentBase, Sungero.Domain.Interfaces" IsSimpleDataType="false" EntityTypeId="96c4f4f3-dc74-497a-b347-e8faf4afe320"/>
  </Dictionary>
  <ReportPage Name="Page1" Landscape="true" PaperWidth="229.1" PaperHeight="162.1" RawPaperSize="28" LeftMargin="0" TopMargin="0" RightMargin="0" BottomMargin="0" FirstPageSource="15" OtherPagesSource="15" Watermark.Font="Arial, 60pt">
    <DataBand Name="Data1" Width="866" Height="612.36" DataSource="Table">
      <TextObject Name="FromLines" Left="37.8" Top="79.38" Width="321.3" Height="126.63" Font="Arial, 10pt" LineHeight="24.57">
        <Highlight>
          <Condition Expression="![PrintSender]" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
        </Highlight>
      </TextObject>
      <TextObject Name="ToLines" Left="415.8" Top="372.33" Width="378" Height="151.2" Font="Arial, 10pt" LineHeight="24.57"/>
      <ZipCodeObject Name="ZipCode" Left="37.8" Top="519.75" Width="238.14" Height="55.92" Expression="[LetterRequisites.ToZipCode]" Text="      "/>
      <TextObject Name="ImagePlaceholder" Left="37.8" Top="236.25" Width="321.3" Height="255.15" Fill.Color="Gainsboro" Text="(Зона иллюстрации)" HorzAlign="Center" VertAlign="Center" Font="Arial, 10pt">
        <Highlight>
          <Condition Expression="0 == 0" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
        </Highlight>
      </TextObject>
      <TextObject Name="ZipCodeTo" Left="415.8" Top="519.75" Width="151.2" Height="30.24" Border.Lines="All" Text="[LetterRequisites.ToZipCode]" HorzAlign="Center" VertAlign="Bottom" Font="Arial, 14pt"/>
      <TextObject Name="ZipCodeToPlaceholder" Left="415.8" Top="514.08" Width="151.2" Height="18.9" Text="Индекс места назначения" HorzAlign="Center" VertAlign="Center" Font="Arial, 6.75pt, style=Italic"/>
      <TextObject Name="ZipCodeFrom" Left="226.8" Top="202.23" Width="132.3" Height="30.24" Border.Lines="All" Text="[LetterRequisites.FromZipCode]" HorzAlign="Center" VertAlign="Bottom" Font="Arial, 11.25pt">
        <Highlight>
          <Condition Expression="![PrintSender]" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
        </Highlight>
      </TextObject>
      <TextObject Name="StampsCorner" Left="752.22" Top="66.15" Width="56.7" Height="56.7" Border.Lines="Right, Top" HorzAlign="Center" VertAlign="Center" Font="Arial, 10pt"/>
      <TextObject Name="ZipCodeFromPlaceholder" Left="226.8" Top="196.56" Width="132.3" Height="18.9" Text="Индекс места отправления" HorzAlign="Center" VertAlign="Center" Font="Arial, 6pt, style=Italic">
        <Highlight>
          <Condition Expression="![PrintSender]" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
        </Highlight>
      </TextObject>
      <TextObject Name="ToPlaceLabel" Left="415.8" Top="423.36" Width="47.25" Height="24.57" Fill.Color="White" Text="Куда" Padding="0, 0, 0, 0" VertAlign="Bottom" Font="Arial, 10pt, style=Italic"/>
      <TextObject Name="ToNameLabel" Left="415.8" Top="374.22" Width="47.25" Height="24.57" Fill.Color="White" Text="Кому" Padding="0, 0, 0, 0" VertAlign="Bottom" Font="Arial, 10pt, style=Italic"/>
      <TextObject Name="FromNameField1" Left="105.08" Top="79.38" Width="481.95" Height="24.57" BreakTo="FromNameField2" Text="[LetterRequisites.FromName]" Padding="0, 0, 0, 0" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="52.92">
        <Highlight>
          <Condition Expression="![PrintSender]" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
          <Condition Expression="Length([LetterRequisites.FromName]) &gt; 210" Font="Arial, 6.75pt" ApplyTextFill="false" ApplyFont="true"/>
          <Condition Expression="Length([LetterRequisites.FromName]) &gt; 110 &amp; Length([LetterRequisites.FromName]) &lt;= 210" Font="Arial, 8.25pt" ApplyTextFill="false" ApplyFont="true"/>
        </Highlight>
      </TextObject>
      <TextObject Name="FromPlaceField1" Left="105.08" Top="128.52" Width="255.15" Height="24.57" Border.Lines="Bottom" Border.Width="0.5" BreakTo="FromPlaceField2" Text="[LetterRequisites.FromPlace]" Padding="0, 0, 0, 0" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="52.92">
        <Highlight>
          <Condition Expression="![PrintSender]" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
        </Highlight>
      </TextObject>
      <TextObject Name="FromPlaceField2" Left="37.8" Top="153.09" Width="321.3" Height="24.57" Border.Lines="Bottom" Border.Width="0.5" BreakTo="FromPlaceField3" Padding="0, 0, 0, 0" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="52.92">
        <Highlight>
          <Condition Expression="![PrintSender]" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
        </Highlight>
      </TextObject>
      <TextObject Name="FromNameLabel" Left="37.04" Top="81.27" Width="67.28" Height="24.57" Fill.Color="White" Text="От кого" Padding="0, 0, 0, 0" VertAlign="Bottom" Font="Arial, 10pt, style=Italic">
        <Highlight>
          <Condition Expression="![PrintSender]" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
        </Highlight>
      </TextObject>
      <TextObject Name="FromPlaceLabel" Left="37.04" Top="130.41" Width="67.28" Height="24.57" Fill.Color="White" Text="Откуда" Padding="0, 0, 0, 0" VertAlign="Bottom" Font="Arial, 10pt, style=Italic">
        <Highlight>
          <Condition Expression="![PrintSender]" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
        </Highlight>
      </TextObject>
      <TextObject Name="ToNameField1" Left="463.05" Top="372.33" Width="330.75" Height="24.57" Border.Lines="Bottom" Border.Width="0.5" BreakTo="ToNameField2" Text="[LetterRequisites.ToName]" Padding="0, 0, 0, 0" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="47.25"/>
      <TextObject Name="ToNameField2" Left="415.8" Top="396.9" Width="378" Height="24.57" Padding="0, 0, 0, 0" AutoWidth="true" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="47.25"/>
      <TextObject Name="ToPlaceField1" Left="463.05" Top="421.47" Width="330.75" Height="24.57" Border.Lines="Bottom" Border.Width="0.5" BreakTo="ToPlaceField2" Text="[LetterRequisites.ToPlace]" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="47.25"/>
      <TextObject Name="ToPlaceField2" Left="415.8" Top="446.04" Width="378" Height="24.57" Border.Lines="Bottom" Border.Width="0.5" BreakTo="ToPlaceField3" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="47.25"/>
      <TextObject Name="ToPlaceField3" Left="415.8" Top="470.61" Width="378" Height="24.57" Border.Lines="Bottom" Border.Width="0.5" BreakTo="ToPlaceField4" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="47.25"/>
      <TextObject Name="ToPlaceField4" Left="415.8" Top="495.18" Width="378" Height="24.57" AutoWidth="true" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="47.25"/>
      <TextObject Name="FromPlaceField3" Left="37.8" Top="153.09" Width="321.3" Height="24.57" Padding="0, 0, 0, 0" AutoWidth="true" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="52.92">
        <Highlight>
          <Condition Expression="![PrintSender]" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
        </Highlight>
      </TextObject>
      <TextObject Name="Text1" Left="105.08" Top="79.38" Width="255.15" Height="24.57" Border.Lines="Bottom" Border.Width="0.5" Padding="0, 0, 0, 0" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="52.92">
        <Highlight>
          <Condition Expression="![PrintSender]" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
        </Highlight>
      </TextObject>
      <TextObject Name="Text2" Left="37.8" Top="177.66" Width="321.3" Height="24.57" Border.Lines="Bottom" Border.Width="0.5" Padding="0, 0, 0, 0" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="52.92">
        <Highlight>
          <Condition Expression="![PrintSender]" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
        </Highlight>
      </TextObject>
      <TextObject Name="Text3" Left="415.8" Top="396.9" Width="378" Height="24.57" Border.Lines="Bottom" Border.Width="0.5" Padding="0, 0, 0, 0" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="47.25"/>
      <TextObject Name="Text4" Left="415.8" Top="495.18" Width="378" Height="24.57" Border.Lines="Bottom" Border.Width="0.5" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="47.25"/>
      <TextObject Name="Text5" Left="37.8" Top="103.95" Width="321.3" Height="24.57" Border.Lines="Bottom" Border.Width="0.5" Padding="0, 0, 0, 0" VertAlign="Bottom" Font="Arial, 10pt" FirstTabOffset="52.92">
        <Highlight>
          <Condition Expression="![PrintSender]" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
        </Highlight>
      </TextObject>
      <TextObject Name="FromNameField2" Left="37.8" Top="104.71" Width="549.23" Height="24.57" Padding="0, 0, 0, 0" VertAlign="Bottom" Font="Arial, 10pt">
        <Highlight>
          <Condition Expression="![PrintSender]" Visible="false" Font="Arial, 10pt" ApplyTextFill="false"/>
          <Condition Expression="Length([LetterRequisites.FromName]) &gt; 210" Font="Arial, 6.75pt" ApplyTextFill="false" ApplyFont="true"/>
          <Condition Expression="Length([LetterRequisites.FromName]) &gt; 110 &amp; Length([LetterRequisites.FromName]) &lt;= 210" Font="Arial, 8.25pt" ApplyTextFill="false" ApplyFont="true"/>
        </Highlight>
      </TextObject>
    </DataBand>
  </ReportPage>
</Report>
